package com.atguigu.mybatis.mapper;

import com.atguigu.mybatis.pojo.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    /**
     * 根据用户名查询用户信息
     * @param username
     * @return
     */
    User getUserByUsername(String username);
    User checkLogin(String username,String password);
    User checkLoginByMap(Map<String,Object> map);
    void insertUser(User user);
    User checkLoginByParam(@Param("username") String username ,@Param("password") String password);
    User getUserById(@Param("id") int id);
    List<User> getUserList();
    int getCount();
    Map<String,Object> getUserToMap(@Param("id") int id);
    List<Map<String,Object>> getAllUserToMap();
    @MapKey("id")
    Map<String,Object> getAllUserToMap2();
    List<User> testMohu(@Param("mohu") String mohu);
    int deleteMore(@Param("ids") String ids);
    List<User> getAllUser(@Param("tableName") String tableName);
    int insertUser2(User user);
}
